﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchAddress.aspx.cs" Inherits="SD.UI.SearchAddress" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Search Postcode</title>
    <link type="text/css" rel="Stylesheet" href="CSS/Style.css" />
    <script type="text/javascript">
            function ShowLeadContacts()  
              {  
               window.open('AddAddress.aspx','_blank','scrollbars=1, width=800px,height=400px');  
              }
              function Return()
                {         
                    window.close();
                }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="100%">
            <tr>
                <td>
                    <div>
                        <asp:Panel ID="PanelSearchHeader" runat="server">
                            <div>
                                <table width="100%">
                                    <tr>
                                        <td>
                                            <div>
                                                <asp:Label ID="lbPostcode" runat="server" Text="Postcode:">
                                                </asp:Label>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <asp:TextBox ID="tbxPostcode" runat="server">
                                                </asp:TextBox>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <asp:Label ID="lbStreet" runat="server" Text="Street:">
                                                </asp:Label>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <asp:TextBox ID="tbxStreet" runat="server">
                                                </asp:TextBox>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <asp:Label ID="lbTown" runat="server" Text="Town:">
                                                </asp:Label>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <asp:TextBox ID="tbxTown" runat="server">
                                                </asp:TextBox>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </asp:Panel>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="float:left">
                    <div class="navi">
                        <div>
                            <asp:Button ID="btnSearchAddress" runat="server" Text="Search" 
                                onclick="btnSearchAddress_Click" CssClass="Button" />
                        </div>    
                        <div>
                            <asp:Button ID="btnNone" runat="server" Text="None" onclick="btnNone_Click" 
                                CssClass="Button" />
                        </div>
                        <div>
                            <asp:Button ID="btnCreate" runat="server" Text="Create" 
                                OnClientClick="ShowLeadContacts()" CssClass="Button"/>
                        </div>
                        <div>
                            <asp:Button ID="btnClear" runat="server" Text="Clear" 
                            onclick="btnClear_Click" CssClass="Button" />
                        </div>
                    </div>
                    
                </td>
            </tr>
            <tr>
                <td>
                    <div>
                        <asp:Panel ID="PanelFooterSearch" runat="server">
                            <div>
                                <asp:GridView ID="gvSearchAddress" runat="server" AutoGenerateColumns="False" 
                                    DataKeyNames="AddressID" BackColor="White" BorderColor="#E7E7FF" 
                                    BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                                    GridLines="Horizontal" Width="100%" AllowPaging="True" 
                                    onpageindexchanging="gvSearchAddress_PageIndexChanging">
                                    <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Select">
                                            <ItemTemplate>
                                                <asp:RadioButton ID="rdbChoose" runat="server" AutoPostBack="True" 
                                                    CausesValidation="True" GroupName="selectContact" 
                                                    oncheckedchanged="rdbChoose_CheckedChanged" ValidationGroup="selectContact"/>
                                                
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="Address" HeaderText="Address" />
                                        <asp:BoundField DataField="Postcode" HeaderText="Postcode" />
                                        <asp:BoundField DataField="Town" HeaderText="Town" />
                                        <asp:BoundField DataField="County" HeaderText="County" />
                                        <asp:BoundField DataField="Country" HeaderText="Country" />
                                    </Columns>
                                    <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                                    <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                                    <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                                    <AlternatingRowStyle BackColor="#F7F7F7" />
                                </asp:GridView>
                                <asp:Label ID="lblMessage" runat="server" Text="" ForeColor="Red"></asp:Label>
                            </div>
                        </asp:Panel>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="float:left">
                    <div class="navi">
                        <div>
                            <asp:Button ID="btnSelect" runat="server" Text="Select" 
                            onclick="btnSelect_Click" CssClass="Button" />
                        </div>                        
                        <div onclick="Return()">
                            <asp:Button ID="btnClose" runat="server" Text="Close" 
                            onclick="btnClose_Click" CssClass="Button" />
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
